import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Mythread34 {
    public static void main(String[] args) {
        ExecutorService pool5=Executors.newFixedThreadPool(10);
        pool5.submit(new Runnable() {
            @Override
            public void run() {
                for(int i=0;i<1000;i++)
                {
                    int n=i;
                    System.out.println(n);
                }

            }
        });
    }
    public static void main3(String[] args) {
        ExecutorService pool4=Executors.newSingleThreadExecutor();
        pool4.submit(new Runnable() {
            @Override
            public void run() {
                for(int i=0;i<100;i++)
                {
                    int n=i;
                    System.out.println(n);
                }

            }
        });
    }
    public static void main2(String[] args) {
        ExecutorService  pool3=Executors.newScheduledThreadPool(20);
        pool3.submit(new Runnable() {
            @Override
            public void run() {
                for(int i=0;i<100;i++)
                {
                    int n=i;
                    System.out.println(n);
                }

            }
        });
    }
    public static void main1(String[] args)
    {
        ExecutorService pool2=Executors.newCachedThreadPool();
        pool2.submit(new Runnable() {
            @Override
            public void run() {
                for(int i=0;i<1000;i++)
                {
                    int n=i;
                    System.out.println(n);
                }

            }
        });
    }
}
